package ink.tiptop.enums;

import ink.tiptop.constant.RespConst;

/**
 * @author ink.tiptop.zjf
 * @Title: Ticket
 * @Package ink.tiptop.dto.resp
 * @Description:
 * @date 2020-07-20 09:39
 */
public enum EResp {

    SUCCESS("00000000", "操作成功"),
    ERROR("99999999", "未知异常");

    public String respCode;
    public String respMsg;

    EResp(String respCode, String respMsg) {
        this.respCode = respCode;
        this.respMsg = respMsg;
    }

    public enum EUserAuth {
        ERROR_ADD("100001", "用户信息添加失败"),
        ERROR_DELETE("100002", "用户信息删除失败"),
        ERROR_UPDATE("100003", "用户信息更新失败"),
        ERROR_QUERY("100004", "用户信息查询失败"),

        ERROR_EXIST_NOT("100005", "用户信息不存在"),
        ERROR_EXIST("100006", "用户信息已经存在"),

        ERROR_PASS("100007", "用户密码错误"),
        ERROR_LOGOUT("100008", "用户登出失败"),
        ERROR_LOGIN_TO_MANY("100009", "客官,慢点慢点"),
        ERROR_CONFIRM_PASSWORD("100010", "确认密码错误")
        ;

        public String respCode;
        public String respMsg;

        EUserAuth(String respCode, String respMsg) {
            this.respCode = RespConst.AUTH_USER_INFO + respCode;
            this.respMsg = respMsg;
        }
    }

    public enum EVersion {
        ERROR_ADD("100001", "版本信息添加失败"),
        ERROR_DELETE("100002", "版本信息删除失败"),
        ERROR_UPDATE("100003", "版本信息更新失败"),
        ERROR_QUERY("100004", "版本信息查询失败"),

        ERROR_EXIST_NOT("100005", "版本信息不存在"),
        ERROR_EXIST("100006", "版本信息已经存在"),

        ERROR_DELETE_PART("100009", "部分关联数据未删除,请先解除模块本地视模块图关联的版本信息"),
        ERROR_DELETE_FORBID("100010", "数据关联未解除,请先解除模块本地视模块图关联的版本信息");

        public String respCode;
        public String respMsg;

        EVersion(String respCode, String respMsg) {
            this.respCode = RespConst.USER_MODULE_VERSION + respCode;
            this.respMsg = respMsg;
        }
    }

    public enum EServerInfo {
        ERROR_ADD("100001", "服务器信息添加失败"),
        ERROR_DELETE("100002", "服务器信息删除失败"),
        ERROR_UPDATE("100003", "服务器信息更新失败"),
        ERROR_QUERY("100004", "服务器信息查询失败"),

        ERROR_EXIST_NOT("100005", "服务器信息不存在"),
        ERROR_EXIST("100006", "服务器信息已经存在"),
        ERROR_PASS_EXIST("100007", "连接方式为密码时,密码选项不能为空"),
        ERROR_PUBKEY_EXIST("100008", "连接方式为key时,PubKey选项不能为空"),
        ERROR_DELETE_PART("100009", "部分关联数据未删除,请先解除远程视图中关联的服务器信息"),
        ERROR_DELETE_FORBID("100010", "数据关联未解除,请先解除远程视图中关联的服务器信息"),
        ERROR_PATH_LIMITED("100011", "远程搜索的路径至少是两层以上,比如/opt/app"),
        ERROR_CONNECT_ERROR("100012", "连接服务器异常");
        public String respCode;
        public String respMsg;

        EServerInfo(String respCode, String respMsg) {
            this.respCode = RespConst.BASE_SERVER_INFO + respCode;
            this.respMsg = respMsg;
        }
    }

    public enum EViewLocal {
        ERROR_ADD("100001", "本地模块视图添加失败"),
        ERROR_DELETE("100002", "本地模块视图删除失败"),
        ERROR_UPDATE("100003", "本地模块视图更新失败"),
        ERROR_QUERY("100004", "本地模块视图查询失败"),

        ERROR_EXIST_NOT("100005", "本地模块视图不存在"),
        ERROR_EXIST("100006", "本地模块视图已经存在"),

        ERROR_SCAN("100007", "未扫描到本地模块"),
        ERROR_NOT_DIR("100008", "本地模块必须是文件夹"),
        ERROR_STANDARD("100009", "标准模块未识别到其他配置"),
        ERROR_PARAM("100010", "入参异常"),

        ERROR_PARAM_SRC("100011", "自定义输出下,src文件位置不能为空"),
        ERROR_PARAM_POM("100012", "自定义输出下,pom文件位置不能为空"),
        ERROR_PARAM_JAR("100013", "自定义输出下,输出jar位置不能为空"),
        ERROR_PARAM_TARGET("100014", "自定义输出下,输出target不能为空"),
        ERROR_TARGET_MAKE_SURE("100015", "路径中不包含target路径,请检查是否已经打包了项目");
        public String respCode;
        public String respMsg;

        EViewLocal(String respCode, String respMsg) {
            this.respCode = RespConst.MODULE_LOCAL_VIEW + respCode;
            this.respMsg = respMsg;
        }
    }

    public enum EModuleLocal {
        ERROR_ADD("100001", "本地模块添加失败"),
        ERROR_DELETE("100002", "本地模块删除失败"),
        ERROR_UPDATE("100003", "本地模块更新失败"),
        ERROR_QUERY("100004", "本地模块查询失败"),

        ERROR_EXIST_NOT("100005", "本地模块不存在"),
        ERROR_EXIST("100006", "本地模块已经存在"),

        ERROR_SCAN("100007", "未扫描到本地模块"),
        ERROR_NOT_DIR("100008", "本地模块必须是文件夹"),
        ERROR_STANDARD("100009", "标准模块未识别到其他配置"),
        ERROR_PARAM("100010", "入参异常"),

        ERROR_PARAM_SRC("100011", "自定义输出下,src文件位置不能为空"),
        ERROR_PARAM_POM("100012", "自定义输出下,pom文件位置不能为空"),
        ERROR_PARAM_JAR("100013", "自定义输出下,输出jar位置不能为空"),
        ERROR_PARAM_TARGET("100014", "自定义输出下,输出target不能为空"),
        ERROR_TARGET_MAKE_SURE("100015", "路径中不包含target路径,请检查是否已经打包了项目"),
        ERROR_INSTALL_FIRST("100016", "请先把模块打包到本地"),
        ERROR_INSTALL_SCAN_JAR("100016", "没有扫描到jar包"),
        ERROR_INSTALL_SCAN_JAR_TO_MANY("100016", "扫描到多个jar包");
        public String respCode;
        public String respMsg;

        EModuleLocal(String respCode, String respMsg) {
            this.respCode = RespConst.MODULE_LOCAL + respCode;
            this.respMsg = respMsg;
        }
    }

    public enum EViewRemote {
        ERROR_ADD("100001", "远程视图添加失败"),
        ERROR_DELETE("100002", "远程视图删除失败"),
        ERROR_UPDATE("100003", "远程视图更新失败"),
        ERROR_QUERY("100004", "远程视图查询失败"),

        ERROR_EXIST_NOT("100005", "远程视图不存在"),
        ERROR_EXIST("100006", "远程视图已经存在"),
        ERROR_SCAN_ERROR("100007", "远程视图扫描失败"),

        ERROR_DELETE_PART("100009", "部分关联数据未删除,请先解除模块本地视图关联的远程视图"),
        ERROR_DELETE_FORBID("100010", "数据关联未解除,请先解除模块本地视图关联的远程视图");
        public String respCode;
        public String respMsg;

        EViewRemote(String respCode, String respMsg) {
            this.respCode = RespConst.SERVICE_REMOTE_VIEW + respCode;
            this.respMsg = respMsg;
        }
    }

    public enum EKey {
        ERROR_ADD("100001", "公钥添加失败"),
        ERROR_DELETE("100002", "公钥删除失败"),
        ERROR_UPDATE("100003", "公钥更新失败"),
        ERROR_QUERY("100004", "公钥查询失败"),

        ERROR_EXIST_NOT("100005", "公钥不存在"),
        ERROR_EXIST("100006", "公钥已经存在"),
        ERROR_DELETE_PART("100009", "部分关联数据未删除,请先解除服务器基本信息关联的公钥"),
        ERROR_DELETE_FORBID("100010", "数据关联未解除,请先解除服务器基本信息关联的公钥");
        public String respCode;
        public String respMsg;

        EKey(String respCode, String respMsg) {
            this.respCode = RespConst.KEY + respCode;
            this.respMsg = respMsg;
        }
    }

    public enum EPublish {
        ERROR_INSTALL_LOCAL("100001", "本地打包失败"),
        ERROR_INSTALL_PART_SUCCESS("100002", "本地打包部分失败"),
        ERROR_DELETE_FORBID("100010", "");
        public String respCode;
        public String respMsg;

        EPublish(String respCode, String respMsg) {
            this.respCode = RespConst.PUBLISH + respCode;
            this.respMsg = respMsg;
        }
    }
}
